/*
 *  Copyright 2008-2010 www.jrails.org
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package org.rails.extjs;



public abstract class BoxComponent extends Component {
	
	public static final String REGION_EAST = "east";
	public static final String REGION_SOUTH = "south";
	public static final String REGION_WEST = "west";
	public static final String REGION_NORTH = "north";
	public static final String REGION_CENTER = "center";

	public BoxComponent() {
		super();
	}
	
	public BoxComponent(Option configOptions) {
		super(configOptions);
	}
	
	public BoxComponent(String id) {
		super(id);
	}
	
	public void setAutoHeight(Boolean autoHeight){
		addOption("autoHeight",autoHeight);
	}
	
	public Boolean isAutoHeight(){
		return getBoolean("autoHeight",false);
	}
	
	public void setHeight(Integer height){
		addOption("height",height);
	}
	
	public Integer getHeight(){
		return getInteger("height",0);
	}
	
	public void setAutoWidth(Boolean autoWidth){
		addOption("autoWidth",autoWidth);
	}
	
	public Boolean isAautoWidth(){
		return getBoolean("autoWidth",false);
	}
	
	public void setWidth(Integer width){
		addOption("width",width);
	}
	
	public Integer getWidth(){
		return getInteger("width",0);
	}
	
	public void setBoxMaxHeight(Integer boxMaxHeight){
		addOption("boxMaxHeight", boxMaxHeight);
	}
	
	public Integer getBoxMaxHeight(){
		return getInteger("boxMaxHeight", 0);
	}
	
	public void setBoxMaxWidth(Integer boxMaxWidth){
		addOption("boxMaxWidth", boxMaxWidth);
	}
	
	public Integer getBoxMaxWidth(){
		return getInteger("boxMaxWidth", 0);
	}
	
	public void setBoxMinHeight(Integer boxMinHeight){
		addOption("boxMinHeight", boxMinHeight);
	}
	
	public Integer getBoxMinHeight(){
		return getInteger("boxMinHeight", 0);
	}
	
	public void setBoxMinWidth(Integer boxMinWidth){
		addOption("boxMinWidth", boxMinWidth);
	}
	
	public Integer getBoxMinWidth(){
		return getInteger("boxMinWidth", 0);
	}
	
	public void setRegion(String region){
		addOption("region",region);
	}
	
	public String getRegion(){
		return getString("region","");
	}
	
	public void setX(Integer x){
		addOption("x",x);
	}
	
	public Integer getX(){
		return getInteger("x",0);
	}
	
	public void setY(Integer y){
		addOption("y",y);
	}
	
	public Integer getY(){
		return getInteger("y",0);
	}
	
	public void setMargins(Margins margins){
		addOption("margins",margins);
	}
	
	public void setFlex(Integer flex){
		addOption("flex",flex);
	}
	
	public Integer getFlex(){
		return getInteger("flex",0);
	}
	
	public Margins getMargins(){
		return (Margins)getOption("margins");
	}

}
